<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html version="HTML+RDFa 1.1" lang="vi">
<head>

    <meta http-equiv="x-dns-prefetch-control" content="on">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Trang quản trị - Thêm hình ảnh sản phẩm</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <meta name="viewport" content="width=1024">

    <link rel="icon" href="../../images/ico/favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="../../images/ico/favicon.ico" type="image/x-icon">
    <link rel="apple-touch-icon-precomposed" href="../../images/head/apple-touch-icon-precomposed.png">
    <link rel="apple-touch-icon" href="../../images/head/apple-touch-icon.png">

    <link rel="stylesheet" type="text/css" href="../../library/jquery-ui/jquery-ui.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-common/alice-vnfas-core-v29a01739e3cd.css" media="all">
    <link rel="stylesheet" type="text/css" href="../../css/style-common/alice-vnfas-main-v7fb7ea25b252.css" media="all">
    <link rel="stylesheet" type="text/css" href="../../css/style-body/body-regedit/alice-vnfas-account-v272d129423cd.css" media="all">

    <link rel="stylesheet" type="text/css" href="../../css/style-body/body-admin/body-tablescroll-non-line.css" media="all">
    <link rel="stylesheet" type="text/css" href="../../css/style-body/body-admin/body-input.css" media="all">
    <link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/css/style-input/body-table-input-common.css" media="all">
    <link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/library/uploadify/uploadfile.css" media="all">

    <script type="text/javascript" src="../../library/jquery-1.9.1.js"></script>
    <script type="text/javascript" src="../../library/jquery-ui/jquery-ui.js"></script>
    <script type="text/javascript" src="../../library/uploadify/jquery.uploadfile.js"></script>
    <script type="text/javascript" src="../../js/wrapper.js"></script>
    <script type="text/javascript" src="../../js/admin/ad-product-picture.js"></script>

<%--    <script type="text/javascript">
        window.onload = function(){
            //Check File API support
            if(window.File && window.FileList && window.FileReader)
            {
                $('#files').live("change", function(event) {
                    var files = event.target.files; //FileList object
                    var output = document.getElementById("result");
                    for(var i = 0; i< files.length; i++)
                    {
                        var file = files[i];
                        //Only pics
                        // if(!file.type.match('image'))
                        if(file.type.match('image.*')){
                            if(this.files[0].size < 2097152){
                                // continue;
                                var picReader = new FileReader();
                                picReader.addEventListener("load",function(event){
                                    var picFile = event.target;
                                    var div = document.createElement("div");
                                    div.innerHTML = "<img class='thumbnail' src='" + picFile.result + "'" +
                                            "title='" + picFile.result + "'/>";
                                    output.insertBefore(div,null);
                                });
                                //Read the image
                                $('#clear, #result').show();
                                picReader.readAsDataURL(file);
                            }else{
                                alert("Image Size is too big. Minimum size is 2MB.");
                                $(this).val("");
                            }
                        }else{
                            alert("You can only upload image file.");
                            $(this).val("");
                        }
                    }
                    alert(files.length + ' ' + event.target.result);

                });
            }
            else
            {
                console.log("Your browser does not support File API");
            }
        }

        $('#files').live("click", function() {
            $('.thumbnail').parent().remove();
            $('result').hide();
            $(this).val("");
        });

        $('#clear').live("click", function() {
            $('.thumbnail').parent().remove();
            $('#result').hide();
            $('#files').val("");
            $(this).hide();
        });
    </script>--%>

    <%--<script type="text/javascript">--%>
        <%--function InsertInputFunction(number) {--%>
<%--//            alert("The input value has changed. The new value is: " + number);--%>
            <%--ISS.SESSION.setSession('session_PictureNumber', number);--%>
<%--//            var mang = [];--%>
            <%--var n ='';--%>
            <%--if (number>0){--%>
                <%--for(var i=0; i<number; i++) {--%>
                    <%--n += '<div class="ui-formRow mbn">\--%>
                                <%--<label class="mts col1 required">Chọn ảnh thứ '+ (i+1) +': <span class="required">*</span>\--%>
                                <%--</label>\--%>
                                <%--<input class="ui-inputPassword" id="ProductPicture_name_'+i+'" type="file">\--%>
                             <%--</div>';--%>
<%--//                    mang[i] = document.getElementById('ProductPicture_name_'+i);--%>
<%--//                    alert(mang[i]);--%>
<%--//                    ISS.SESSION.setSession('session_PictureName_'+i, mang[i]);--%>
                <%--}--%>
            <%--}--%>
            <%--else{--%>
                <%--n = 'Không được nhập số âm';--%>
            <%--};--%>
            <%--document.getElementById("ProductPicture_showInput").innerHTML = n;--%>
        <%--}--%>
    <%--</script>--%>

</head>

<body class="js l-full-hd ui-page-bg  thm-core thm-local_redesign thm-vnfas  l-hasSidebar no-touch">

<div id="page" class="l-page">
    <div id="header">
        <%@include file="../iframe/header-ad.jsp" %>
    </div>
</div>

<div id="content">
    <div class="l-pageWrapper">
        <div>
            <div id="login" class="line mbm box-bgcolor">
                <div class="">
                    <div class="box">
                        <div class="ui-borderBottom mbm txtColor login__title fsml">THÊM HÌNH ẢNH CHI TIẾT SẢN PHẨM</div>
                        <div class="login__form">
                            <form id="form-account-login" action="" method="post">
                                <div class="clearfix loginForm">
                                    <fieldset class="ui-fieldset">

                                        <div class="ui-formRow mbn">
                                            <label class="mts col1 required">Chọn sản phẩm <span class="required">*</span>
                                            </label>
                                            <select class="sorting b-catalogList__sortSelect fsm textCatalogTitleBlack" id="ProductPicture_product">
                                            </select>
                                        </div>
                                        <div id="upload_template">
                                            <div id="multipleupload">Upload</div>
                                        </div>
                                        <div id="buttonProductDetailPicture_Add" class="align-center padding">
                                            <div id="startUpload" class="ajax-file-upload-green">Thêm ảnh</div>
                                        </div>

                                    <%--<div class="ui-formRow mbn">--%>
                                            <%--<label class="mts col1 required">Nhập số lương ảnh cần upload <span class="required">*</span>--%>
                                            <%--</label>--%>
                                            <%--<input class="ui-inputPassword" id="ProductPicture_number" type="text" onchange="InsertInputFunction(this.value)">--%>
                                        <%--</div>--%>
                                        <%--<div id="ProductPicture_showInput"></div>--%>
                                        <%--<output id="ProductPicture_showInput" />--%>
<%--                                        <div class="ui-formRow mbn">
                                            <article>
                                            <label for="files">Chọn ảnh cho sản phẩm này: </label>
                                            <input id="files" type="file" multiple/>
                                            <button type="button" id="clear">Clear</button>
                                            <output id="result" />
                                            </article>
                                        </div>--%>

                                        <%--<div class="ui-formRow mts mbn align-center padding">--%>
                                            <%--<button class="btn btn-dark login__button" id="ProductPicture_Add1" type="button">Thêm</button>--%>
                                        <%--</div>--%>
                                    </fieldset>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>


            </div>
        </div>
    </div>
</div>

<%--<div id="boxTrackConfirm" class="tracking-form-modal-admin hideBox">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="tracking-form__header modal-header">
                <div class="tracking-form__header--title">Bạn muốn thêm chi tiết cho sản phẩm này?</div>
            </div>
            <div class="tracking-form__body modal-body">
                <form class="trackingOrderForm" action="" method="post">
                    <div class="ui-formRow mtl mbn">
                        <div class="mtm mbs tracking-form__body--submit">
                            <button id="buttonAddProductDetail_Agree" type="button" class="btn btn-dark strong">Đồng ý</button>
                            <button id="buttonAddProductDetail_Cancel" type="button" class="btn btn-dark strong">Hủy bỏ</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>--%>

<footer id="footer" class="ptl mtl">
    <hr>

</footer>
</body>
</html>
